Animation Controller Events
Animation controllers can trigger events on entry or exit of a state. Events to trigger on state entry go in the "on_entry" section, those on exit go in the "on_exit" section.
Animation Events
Animations can have a timeline dedicated to events. The "timeline" section contains the event timeline list. Below there are various examples where particular times can trigger a single event, or an array of events:
Animation Notes
Entity events occur in animations, which normally occur on the client (via resource packs), but can also occur on the server (via behavior packs). As the server side of the game has no visual aspects to it, obviously no bone-based animations can occur. However, a traditional animation is basically a timeline of events, with the events being bone positions for an animated visual rig that moves the entity's visual shape around.
The mechanisms for the Bedrock animation system are state machines (Animation Controllers), and timelines (Animations). These concepts apply directly to the triggering of events, thus the animation system can execute on the server (minus the visual aspects), with the intent of driving entity events.
Events
Events consist of three categories, all represented by a string:
- Entity events
- Slash Commands
- Molang Expressions
General Notes
This document contains details for driving various events via entity .json data. Entity events can go in both behavior and resource packs. Behavior packs use the same animations and animation controllers setup that are used in resource packs, albeit with a different method in the entity .json itself to activate the animations.
Entity events are a way to drive gameplay and entity state changes in the Bedrock engine. These events can typically include slash commands (behavior packs only), entity events (e.g. become an adult), and Molang expressions (e.g. set the Molang variable "variable.foo" to 3 on a particular entity). Animations and Animation controllers provide a method for driving state machines and timelines for an entity. For example, a particular animation controller could be in a particular state, and running a particular animation, and we want events triggered when entering/exiting that state. Alternately, an "animation" could be running, and we wish to fire off events during that animation. The entity event timeline mechanic makes this possible.